A liquid level detector having a float floating on a liquid surface, a magnet retained by the float, and a switch mechanism such as a reed switch to switch from an off-state to an on-state by the movement of the magnet in the gravity direction, such as an oil level sensor disclosed in Patent Document 1 for example, has heretofore been known. In the liquid level detector, the float comes into contact with a housing and a cover constituting a casing and resultantly the vertical movement of the float in the gravity direction is restricted.